home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5UTL010.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
2KB
|
50 lines
Keeping a lot of directories in the search path set by your
AUTOEXEC.BAT's PATH command is convenient, but it slows your
machine and eats up a sizable chunk of your environment. I
therefore developed a small batch file that lets you add and
remove directories from your PATH on the fly.
NEWPATH.BAT checks each directory on your search path. If a
listed directory doesn't exist, or if it's empty, NEWPATH
removes it. Otherwise, the batch file asks you whether you
want the directory there. Also, if you pass any directory
names to NEWPATH as parameters, the batch file will ask you
if those are to be included as well. NEWPATH affects only
the search path in memory; your AUTOEXEC.BAT file's PATH
command remains unchanged.
Divya Mahajan
New Delhi, India
Editor's Note: NEWPATH.BAT is truly useful if you want to
quickly exclude a few directories from your search path (or
add a few others). It requires two support files: another
batch, NEWPATH1.BAT, and a short program called YN.COM.
YN.COM performs a very simple task: It asks a yes/no
question, waits for a 'Y' or an 'N', and returns an
errorlevel of 1 for yes and 0 for no. YN.COM, along with
NEWPATH.BAT and NEWPATH1.BAT, are included in the P5UTL
directory of your PowerBase *.* Volume 5 diskette.
NEWPATH1.BAT shows how to use the IF EXIST batch command
with wild cards. Because IF EXIST succeeds if any files
match the pattern shown, and all files match *.*, the test
will fail only if the directory is empty or doesn't exist
(either way, it's useless in a search path). To test only
for the existence of a directory, use IF EXIST with a
standard device name such as PRN (which, by DOS convention,
appears in any directory that exists). NEWPATH has one
drawback: The starting size of your PATH command plus the
combined length of your command-line parameters must not
exceed 92 characters. If it does, you'll be left with no
search path in memory at all.
Title: Modify Your PATH on the Fly
Category: UTL
Issue Date: November, 1992
Editor: Brett Glass
Supplementary Files: P5UTL\NEWPATH.BAT, P5UTL\NEWPATH1.BAT, P5UTL\YN.COM
Filename: P5UTL010.TIP